<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="MvcContrib.FluentHtml.ModelViewPage<Universum.Model.Domain.Blogs.Blog>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Edit
</asp:Content>
<asp:Content ID="BreadcrumbsContent" ContentPlaceHolderID="Breadcrumbs" runat ="server">
<%= Html.Breadcrumb().Home().Append<BlogsController>(c=>c.Index(), "Posts from "+ ( Model.Owner?? "blog")).AppendText("Your blog").End() %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
	
	<%= Html.ValidationSummary("Update was unsuccessful. Please correct the errors and try again.") %>
	<% using (Html.BeginForm<BlogsController>(controller => controller.Remove(), FormMethod.Post))
	{
	%>
	<%=this.SubmitButton("Remove blog") %>
	<%
		} %>
	<% using (Html.BeginForm<BlogsController>(controller=>controller.Save(null)))
	{%>
	<fieldset>
		<legend>Edit your blog's information</legend>
		<p>
			<label for="Name">
				Name:</label>
			<%= this.TextBox(m=>m.Name) %>
			<%= this.ValidationMessage(m=>m.Name, "*") %>
		</p>
		<p>
			<label for="Description">
				Description:</label>
			<%= this.TextArea(m=>m.Description) %>
			<%= this.ValidationMessage(m=>m.Description, "*") %>
		</p>
		<p>			
			<%= this.Hidden(m=>m.Owner).Attr("readonly","readonly") %>
			
		</p>
		<p>
			<%= this.Hidden(m=>m.ID)%>
		</p>
		<p>
			<%=this.SubmitButton("Save") %> or 
               <%Html.BeginLink<BlogsController>(it => it.Index()); %>
  Cancel
  <%Html.EndLink(); %>
		</p>
	</fieldset>
	<% } %>
	
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptPlaceHolder" runat="server">
<% Html.RenderPartial("EditorAndDateUserControl"); %>
</asp:Content>
